// page/UserCenter/success/index.js
function countdown(that) {
  var countDownNum = that.data.countDownNum
  var jog = that.data.jog
  var hiddenName = that.data.hiddenName
  if (countDownNum == 0) {
    that.setData({
      countDownNum: "3秒倒计时结束",
      jog:false,
      hiddenName:true
    });
    return;
  }
  var time = setTimeout(function () {
    that.setData({
      countDownNum: countDownNum - 1
    });
    countdown(that);
  }
    , 1000)
}
Page({
  data: {
    countDownNum:5,
    jog:true,
    hiddenName: false,
    amount:0,
    cardNumber:'',
    cardType:''
  },
  onLoad: function (options) {
    countdown(this);
    this.setData({
      cardNumber: options.cardNumber,
      amount: options.amount,
      cardType: options.cardType
    })
  },
  goback(){
    wx.switchTab({
      url: '/page/UserCenter/index',
    })
  }
})